package scau.mis4.chanyulin.tools.utils;

import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import scau.mis4.chanyulin.view.AlertStage;

/**
 * Created by cyl on 2017/3/27
 * 图形化界面工具类
 */
public class UiUtils {

    /**
     * 通过路径获取图片
     * @param path
     */
    public static ImageView getImage(String path) {
        return new ImageView(new Image(path));
    }

    /**
     * 根据布尔值弹出信息提示对话框
     * @param bool
     * @param trueMsg
     * @param falseMsg
     */
    public static void AlertByBool(boolean bool, String trueMsg, String falseMsg) {
        if (bool) new AlertStage(trueMsg).show();
        else new AlertStage(falseMsg).show();
    }

}
